x = []
count = 0
for line in  open('2020.txt'):
    x.append(line.strip())
m = len(x)
n = len(x[0])
print(m,n)
for i in range(m):
    for j in range(n):
        if j <= n-4:
            if x[i][j:j+4] == '2020':
                count += 1
        if i <= m-4:
            if x[i][j] +x[i+1][j]+x[i+2][j]+x[i+3][j] == '2020':
                count += 1
        if i <= m-4 and j <= n-4:
            if x[i][j] + x[i+1][j+1]+x[i+2][j+2]+x[i+3][j+3] == '2020':
                count += 1
print(count)
